<template>
  <div>
    <div class="show_menus" @click="show_menus = !show_menus">
      三
    </div>
    <div v-if="show_menus" class="Menus">
      <div class="top-bar">
        <div class="logo">
          <nuxt-link to="" class="logo-url"><img src="http://api.colinwoo.com/uploads/.md/logo.png" alt="ColinWoo-blog-logo" /></nuxt-link>
        </div>
        <h3 class="desc">
          Logs Book
        </h3>
        <div class="social">
          <p class="">
            <input type="text" v-model="search_value" placeholder="搜索你想找的内容" @keyup.enter="search" />
            <input type="button" value="Search"  @click="search" />
          </p>
          <p><a class="email-url mouse" href="mailto:colinwoo@colinwoo.com" rel="nofollow">ColinWoo@ColinWoo.com</a></p>
          <p><nuxt-link class="record-url mouse" to="http://www.beian.gov.cn/portal/registerSystemInfo?spm=5176.whcolinwoo.7y9jhqsfz.114.3f68f6ffrlCwDF">粤ICP备15089946号-2</nuxt-link></p>
          <!-- <p><nuxt-link class="record-url mouse" :to="{name:'ColinWoo-blog-sitemap'}">sitemap</nuxt-link></p> -->
          <p><span class="record-url mouse">关于我</span></p>
        </div>
      </div>
      <div class="list">
        <nuxt-link class="items mouse" to="/">首页</nuxt-link >
        <nuxt-link  v-for="(items,index) in menuList" :key="index" class="items mouse" :to="{name:'ColinWoo-blog-article_list-category-category_id',params:{category_id:items.category_id}}">{{items.name}}</nuxt-link>
      </div>
    </div>
    <nuxt/>
  </div>
</template>
<script>
export default {
  data(){
     return {
       search_value:'',
       show_menus:true,
     }
  },
  created(){
    this.$store.dispatch("menus/menusList").then(res=>{
        return res.data
    });
  },
  computed: {
    menuList() {//获取分类
      return this.$store.state.menus.menusList
    },
  },
  mounted(){
    if(window.document.body.clientWidth < 1000)
    {
      this.show_menus = false;
    }
  },
  methods: {
    search(){
      this.$router.push({
        path:'/ColinWoo/blog/article_list/category/',
        query:{
          search:this.search_value
        }
      });
    }
  },
  watch: {
    $route (to, from) {
      this.$router.go(0);
  }}
}
</script>
<style>
html {
  font-family: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  word-spacing: 1px;
  -ms-text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  box-sizing: border-box;
}
@media screen and (max-width: 1000px) {
.show_menus{
  display: block;
  font-size: 30px;
  text-align: right;
  padding: 10px;
}
.Menus{
    height: 100vh;
    display: inline-block;
    width: 100%;
    /* border:solid 1px red; */
    padding-top:30px;
    vertical-align:top;
    /* display: none; */
  }
  .Menus > .top-bar{
    height: 40%;
    width: 100%;
  }
  .Menus > .top-bar > .logo{
    width: 100%;
    height: 50%;
  }
  .Menus > .top-bar > .logo > .logo-url{
    width: 100%;
    height:100%;
    display: block;
  }
  .Menus > .top-bar > .logo > .logo-url > img{
    width: 150px;
    height:150px;
    display: block;
    margin:0 auto;
  }
  .Menus > .top-bar > .social{
    text-align: center;
    margin:20px auto;
  }
  /* .Menus > .top-bar > .social > .email{
    height: 30px;
    width: 36px;
    vertical-align:top;
  } */
  .social > p {
    margin-top: 10px;
  }
  .social > p:nth-child(4) ,  .social > p:nth-child(5){
    margin-top: 0px !important;
  }
  .Menus > .top-bar > .social > p >.email-url{
    font-size: 24px;
    font-weight: 200;
    color: #B2B2B2;
    line-height: 24px;
    padding: 0;
  }
  .Menus > .top-bar > .social > p >.record-url{
    font-size: 18px;
    font-weight: 200;
    color:#B2B2B2;
    line-height: 24px;
    padding: 0;
    display: block;
  }
  .Menus > .top-bar > .social > p > .about{
    font-size: 16px;
    font-weight: 200;
    color:#B2B2B2;
    line-height: 24px;
    padding: 0;
    display: block;
  }
  .Menus > .top-bar > .desc{
    font-size: 36px;
    font-weight: bold;
    text-align: center;
    color:#404040;
  }
  .Menus > .top-bar > .logo > img{
    width: 100%;
    height: 100%;
  }
  .list{
    width: 70%;
    margin:80px auto;
  }
  .items{
    text-align: center;
    font-size: 24px;
    line-height: 24px;
    margin:20px 0;
    display: block;
    font-weight: 300;
    color:#404040;
  }
}
@media screen and (min-width: 1000px) {
  .show_menus{
    display: none;
  }
  .Menus{
    height: 100vh;
    display: inline-block;
    width: 24%;
    /* border:solid 1px red; */
    padding-top:30px;
    vertical-align:top;
  }
  .Menus > .top-bar{
    height: 40%;
    width: 100%;
  }
  .Menus > .top-bar > .logo{
    width: 100%;
    height: 50%;
  }
  .Menus > .top-bar > .logo > .logo-url{
    width: 100%;
    height:100%;
    display: block;
  }
  .Menus > .top-bar > .logo > .logo-url > img{
    width: 150px;
    height:150px;
    display: block;
    margin:0 auto;
  }
  .Menus > .top-bar > .social{
    text-align: center;
    margin:20px auto;
  }
  /* .Menus > .top-bar > .social > .email{
    height: 30px;
    width: 36px;
    vertical-align:top;
  } */
  .social > p {
    margin-top: 10px;
  }
  .social > p:nth-child(4) ,  .social > p:nth-child(5){
    margin-top: 0px !important;
  }
  .Menus > .top-bar > .social > p >.email-url{
    font-size: 24px;
    font-weight: 200;
    color: #B2B2B2;
    line-height: 24px;
    padding: 0;
  }
  .Menus > .top-bar > .social > p >.record-url{
    font-size: 18px;
    font-weight: 200;
    color:#B2B2B2;
    line-height: 24px;
    padding: 0;
    display: block;
  }
  .Menus > .top-bar > .social > p > .about{
    font-size: 16px;
    font-weight: 200;
    color:#B2B2B2;
    line-height: 24px;
    padding: 0;
    display: block;
  }
  .Menus > .top-bar > .desc{
    font-size: 36px;
    font-weight: bold;
    text-align: center;
    color:#404040;
  }
  .Menus > .top-bar > .logo > img{
    width: 100%;
    height: 100%;
  }
  .list{
    width: 70%;
    margin:80px auto;
  }
  .items{
    text-align: center;
    font-size: 24px;
    line-height: 24px;
    margin:20px 0;
    display: block;
    font-weight: 300;
    color:#404040;
  }
  .mouse:hover{
    color: #fb5353 !important;
  }
}
</style>

